import {
	ajax
} from "../utils/request.js"

// 抬头列表
export function user_invoice_list() {
	return ajax({
		url: `api.php?m=Api&c=Invoice&a=userInvoiceList`,
	})
}

// 删除抬头
export function del_lnvoice(invoice_id) {
	return ajax({
		url: `api.php?m=Api&c=Invoice&a=delInvoice`,
		method: 'POST',
		data: {
			invoice_id
		}
	})
}

// 设置默认
export function set_default_invoice(invoice_id) {
	return ajax({
		url: `api.php?m=Api&c=Invoice&a=setDefaultInvoice`,
		method: 'POST',
		data: {
			invoice_id
		}
	})
}



// 编辑抬头
export function edit_lnvoice(invoice_id) {
	return ajax({
		url: `api.php?m=Api&c=Invoice&a=editInvoice`,
		method: 'POST',
		data: {
			invoice_id
		}
	})
}



// 编辑保存
export function save_lnvoice(data) {
	return ajax({
		url: `api.php?m=Api&c=Invoice&a=saveInvoice`,
		method: 'POST',
		data
	})
}

// 添加
export function add_lnvoice(data) {
	return ajax({
		url: `api.php?m=Api&c=Invoice&a=addInvoice`,
		method: 'POST',
		data
	})
}

// 订单提交发票申请
export function save_order_invoice(data) {
	return ajax({
		url: `api.php?m=Api&c=Invoice&a=saveOrderInvoice`,
		method: 'POST',
		data
	})
}

// 发票详情
export function order_invoice_detail(order_invoice_id) {
	return ajax({
		url: `api.php?m=Api&c=MyOrder&a=invoiceDetail`,
		method: 'POST',
		data:{
			order_invoice_id
		}
	})
}

// 发票发送邮箱

export function send_invoice(data) {
	return ajax({
		url: `api.php?m=Api&c=MyOrder&a=sendInvoice`,
		method: 'POST',
		data
	})
}
